Add appchooser docs
authorMatthias Clasen <mclasen@redhat.com>
Thu, 6 Jan 2011 07:07:35 +0000 (02:07 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 6 Jan 2011 07:07:35 +0000 (02:07 -0500)
docs/reference/gtk/Makefile.am
docs/reference/gtk/images/appchooserbutton.png [new file with mode: 0644]
docs/reference/gtk/images/appchooserdialog.png [new file with mode: 0644]
docs/reference/gtk/visual_index.xml
docs/tools/widgets.c
gtk/gtkappchooser.c
gtk/gtkappchooserbutton.c
gtk/gtkappchooserdialog.c
gtk/gtkappchooserwidget.c

index 82355f53b3217ce0ea8566354f9142b062c1a3fb..e166f9131b786e37c8c5772eaa67e0d36130fdd5 100644 (file)
@@ -275,6 +275,8 @@ HTML_IMAGES = \
        $(top_srcdir)/gtk/stock-icons/24/gtk-page-setup.png             \
        $(srcdir)/images/aboutdialog.png                                \
        $(srcdir)/images/accel-label.png                                \
+       $(srcdir)/images/appchooserbutton.png                           \
+       $(srcdir)/images/appchooserdialog.png                           \
        $(srcdir)/images/assistant.png                                  \
        $(srcdir)/images/button.png                                     \
        $(srcdir)/images/check-button.png                               \
diff --git a/docs/reference/gtk/images/appchooserbutton.png b/docs/reference/gtk/images/appchooserbutton.png
new file mode 100644 (file)
index 0000000..02b4800
Binary files /dev/null and b/docs/reference/gtk/images/appchooserbutton.png differ
diff --git a/docs/reference/gtk/images/appchooserdialog.png b/docs/reference/gtk/images/appchooserdialog.png
new file mode 100644 (file)
index 0000000..fd9aa70
Binary files /dev/null and b/docs/reference/gtk/images/appchooserdialog.png differ
index 7a11071cefce36339669aa6f20bfaf88d6074dcc..b1e1fe1237fc61ae0aa6e7363a2227b4a1e75561 100644 (file)
@@ -30,6 +30,9 @@
   <link linkend="GtkFontButton">
     <inlinegraphic fileref="font-button.png" format="PNG"></inlinegraphic>
   </link>
+  <link linkend="GtkAppChooserButton">
+    <inlinegraphic fileref="appchooserbutton.png" format="PNG"></inlinegraphic>
+  </link>
   <link linkend="GtkFrame">
     <inlinegraphic fileref="frame.png" format="PNG"></inlinegraphic>
   </link>
   <link linkend="GtkFileChooserDialog">
     <inlinegraphic fileref="filechooser.png" format="PNG"></inlinegraphic>
   </link>
+  <link linkend="GtkAppChooserDialog">
+    <inlinegraphic fileref="appchooserdialog.png" format="PNG"></inlinegraphic>
+  </link>
   <link linkend="GtkSwitch">
     <inlinegraphic fileref="switch.png" format="PNG"></inlinegraphic>
   </link>
index 73081038e604c2d24074f185935206602e61a803..e847442a88e2f816fed19f0e339095555e2153c5 100644 (file)
@@ -1070,6 +1070,39 @@ create_assistant (void)
   return info;
 }
 
+static WidgetInfo *
+create_appchooserbutton (void)
+{
+  GtkWidget *picker;
+  GtkWidget *align, *vbox;
+
+  vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
+  align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+  picker = gtk_app_chooser_button_new ("text/plain");
+  gtk_container_add (GTK_CONTAINER (align), picker);
+  gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (vbox),
+                      gtk_label_new ("Application Button"),
+                      FALSE, FALSE, 0);
+
+  return new_widget_info ("appchooserbutton", vbox, SMALL);
+}
+
+static WidgetInfo *
+create_appchooserdialog (void)
+{
+  WidgetInfo *info;
+  GtkWidget *widget;
+
+  widget = gtk_app_chooser_dialog_new_for_content_type (NULL, 0, "image/png");
+  gtk_window_set_default_size (GTK_WINDOW (widget), 200, 300);
+
+  info = new_widget_info ("appchooserdialog", widget, ASIS);
+  info->include_decorations = TRUE;
+
+  return info;
+}
+
 GList *
 get_all_widgets (void)
 {
@@ -1117,6 +1150,8 @@ get_all_widgets (void)
   retval = g_list_prepend (retval, create_print_dialog ());
   retval = g_list_prepend (retval, create_volume_button ());
   retval = g_list_prepend (retval, create_switch ());
+  retval = g_list_prepend (retval, create_appchooserbutton ());
+  retval = g_list_prepend (retval, create_appchooserdialog ());
 
   return retval;
 }
index cb630c332b9cdb30bcddd9b9ed767e2702095591..c5b93c8af96ffc652d5b103866facfc0e7fdb0ad 100644 (file)
  * Authors: Cosimo Cecchi <ccecchi@redhat.com>
  */
 
+/**
+ * SECTION:gtkappchooser
+ * @Title: GtkAppChooser
+ * @Short_description: Interface implemented by widgets allowing to chooser applications
+ *
+ * #GtkAppChooser is an interface that can be implemented by widgets which
+ * allow the user to choose an application (typically for the purpose of
+ * opening a file). The main objects that implement this interface are
+ * #GtkAppChooserWidget, #GtkAppChooserDialog and #GtkAppChooserButton.
+ */
+
 #include "config.h"
 
 #include "gtkappchooser.h"
index a956a7953c800bdbb90951c6273142df94b2df6d..586c74dd9e7cd03bf991a85566f2b313f143f6a3 100644 (file)
  * Authors: Cosimo Cecchi <ccecchi@redhat.com>
  */
 
+/**
+ * SECTION:gtkappchooserbutton
+ * @Title: GtkAppChooserButton
+ * @Short_description: A button to launch an application chooser dialog
+ *
+ * The #GtkAppChooserButton is a widget that lets the user select
+ * an application. It implements the #GtkAppChooser interface.
+ */
 #include "config.h"
 
 #include "gtkappchooserbutton.h"
index 09f575a76531bceb6e1d398b29a0a127c117ff6a..f83eec4fe8cb81ff25e3d1db9a102f0f588389d1 100644 (file)
  *          Cosimo Cecchi <ccecchi@redhat.com>
  */
 
+/**
+ * SECTION:gtkappchooserdialog
+ * @Title: GtkAppChooserDialog
+ * @Short_description: An application chooser dialog
+ *
+ * #GtkAppChooserDialog shows a #GtkAppChooserWidget inside a #GtkDialog.
+ *
+ * Note that #GtkAppChooserDialog does not have any interesting methods
+ * of its own. Instead, you should get the embedded #GtkAppChooserWidget
+ * using gtk_file_chooser_dialog_get_widget() and call its methods if
+ * the gneeric #GtkAppChooser interface is not sufficient for your needs.
+ */
 #include "config.h"
 
 #include "gtkappchooserdialog.h"
index 5de7c3e7e00cb7d7a7cd9a33ea7653ce8079b228..487f921a1aa853106c8152436fcf999191f03792 100644 (file)
 #include <glib/gi18n-lib.h>
 #include <gio/gio.h>
 
+/**
+ * SECTION:gtkappchooserwidget
+ * @Title: GtkAppChooserWidget
+ * @Short_description: Application chooser widget that can be embedded in other widgets
+ *
+ * #GtkAppChooserWidget is a widget for selecting applications.
+ * It is the main building block for #GtkAppChooserDialog. Most
+ * applications only need to use the latter; but you can use
+ * this widget as part of a larger widget if you have special needs.
+ */
+
 struct _GtkAppChooserWidgetPrivate {
   GAppInfo *selected_app_info;